#ifndef __BLACKBOX_BOXES_DC1394_CDC1394_H__
#define __BLACKBOX_BOXES_DC1394_CDC1394_H__

#include <dc1394/control.h>
#include "cdc1394camera.h"
#include <map>

namespace buola { namespace blackbox {

class CDC1394
{
private:
    CDC1394();
public:
    ~CDC1394();

public:
    void ResetBus();

    CDC1394Camera *GetCamera(int pN);
    CDC1394Camera *GetCameraByUUID(uint64_t pUUID);

    static CDC1394 *Get();
    
private:
    dc1394_t *mDC1394;
    dc1394camera_list_t *mCamNodes;

    /// \todo use unique_ptr once gcc supports them in maps (gcc 4.7)
    std::map<int,CDC1394Camera*> mCameras;
    
    mutex mMutex;
    
    friend class CDC1394Camera;
};

/*namespace blackbox*/ } /*namespace buola*/ }

#endif
